home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Ham⁄GPS / IP Folder / HAMradio TCP⁄IP / Docs / NET⁄ROM_info < prev    next >
Text File  |  1990-07-08  |  17KB  |  428 lines

  1.  
  2.  
  3.                 NET/ROM support in the KA9Q NET Package
  4.  
  5.                             Dan Frank, W9NK
  6.  
  7. INTRODUCTION
  8.  
  9.    The NET/ROM support for the KA9Q package serves three purposes:
  10.  
  11.     1) Existing NET/ROM networks may be used to send IP traffic.
  12.  
  13.     2) NET may be used as a NET/ROM packet switch.
  14.  
  15.     3) NET may be used to communicate with NET/ROM nodes, and its
  16.        mailbox facility can accept connects over the NET/ROM network.
  17.  
  18.  
  19. SETTING UP THE NET/ROM INTERFACE
  20.  
  21.    No physical interface is completely dedicated to net/rom, which is as
  22. it should be.  You attach all your AX.25 interfaces, of whatever sort.
  23. Then you attach the net/rom pseudo-interface ("attach netrom").  Then
  24. you identify to the net/rom software those interfaces you want to allow
  25. it to use, with the "netrom interface" command.  The format of this
  26. command is:
  27.  
  28.     netrom interface ax0 #ipnode 192
  29.  
  30. The first argument is the name of the previously attached interface you
  31. want to use.  The second argument is the alias of your node, to be used in
  32. your routing broadcasts.  The alias is never used for anything else (as
  33. you will see!).  The last number is the net/rom quality figure.  This is
  34. used in computing the route qualities; it represents the contribution of
  35. this interface to the overall computation.  For a 1200 baud half-duplex
  36. connection, 192 is the right number.  
  37.  
  38.    You need a netrom interface command for every interface you're going
  39. to use with net/rom.
  40.  
  41.  
  42. TRACING ON THE NET/ROM INTERFACE
  43.  
  44.    If you want to trace your NET/ROM datagrams, don't try turning
  45. on trace mode for the "netrom" interface.  Nothing will break, but
  46. nothing will happen.  You should trace the individual AX.25 interfaces
  47. instead.
  48.  
  49.  
  50. ROUTING BROADCASTS
  51.  
  52.    Once you have set up your interfaces, you need to set some timers.
  53. There are two:  the nodes broadcast interval timer, and the obsolescence
  54. timer.  These are set in seconds, like the smtp timer.  You should usually
  55. set them to an hour.  You can set them to something different, if you want.
  56. If your local net/rom nodes broadcast every hour, but you want to do so
  57. every ten minutes, you can say:
  58.  
  59.     netrom nodetimer 600
  60.     netrom obsotimer 3600
  61.  
  62. Every time the obsotimer kicks, the obsolescence counts for all non-permanent
  63. entries are decremented by one.  When the count for an entry falls below
  64. five, it is no longer broadcast.  When it falls to 0, it is removed.  The
  65. count is initialized at 6.  These will eventually be settable parameters;
  66. you can adjust them now by changing the initializers for the variables
  67. in the source file.
  68.  
  69.    When you first come on the air, you can send out nodes broadcasts to
  70. tell the local nodes that you are available.  Use the command:
  71.  
  72.     netrom bcnodes ax0
  73.  
  74. where ax0 is the interface on which you want to send the broadcast.  Do
  75. this for every interface on which you want to do this.
  76.  
  77.    By default, the NET/ROM code does not broadcast the contents of your
  78. routing table.  This is as it should be, since usually we just want to
  79. be the endpoints of communications rather than relaying NET/ROM traffic.
  80. If you want to be a switch station, include the command:
  81.  
  82.     netrom verbose yes
  83.  
  84. in your autoexec.
  85.  
  86.    Sometimes you can hear broadcasts from nodes that can't hear you.  If
  87. your routing table gets filled with these unusable routes, your node will
  88. grind to a halt.  The solution to this is node broadcast filtering, via
  89. the netrom nodefilter command.  There is a filter list, which contains
  90. a list of callsigns and interfaces.  Then there is a filter mode, which
  91. indicates what to do with the list.
  92.  
  93.    If the filter mode is "none", no filtering is done.  If it is "accept",
  94. then only broadcasts from the indicated stations on the indicated 
  95. interfaces are accepted.  If it is "reject", then all broadcasts 
  96. except those from the listed stations on the listed interfaces are
  97. accepted.
  98.  
  99.    Because the net/rom code cannot at this time recognize unusable
  100. routes and try alternates, I strongly recommend use of the filter
  101. command to restrict broadcast acceptance to those nodes which you
  102. know you can reach.
  103.  
  104.  
  105. THE NET/ROM ROUTING TABLE
  106.  
  107.    The next net/rom commands are those used for maintaining
  108. the routing table.  They fall under the "netrom route" subcommand.
  109. "netrom add" adds a permanent entry to the routing table.  Its format
  110. is:
  111.  
  112.     netrom route add #foo w9foo ax0 192 w9rly
  113.  
  114. This command adds an entry for w9foo, whose alias is #foo, route
  115. quality 192, via w9rly on interface ax0.  Let's talk about what this
  116. means.  w9foo is the *destination* node, the one to whom you want 
  117. the packets routed by the net/rom network.  w9rly is your *neighbor*,
  118. the net/rom node to which you pass the packet to be forwarded.  Since
  119. w9rly may appear on more than one interface (the callsign may be used
  120. by more than one net/rom node on different bands), we specify that 
  121. we are to use ax0 to send the packet.
  122.  
  123.    With net/rom, like IP, we don't know exactly what route a packet
  124. will take to its destination.  We only know the name of a neighbor
  125. which has indicated a willingness to forward that packet (of course,
  126. the neighbor may be the destination itself, but that's unlikely in
  127. our application).  Net/rom sends the packet to the neighbor, with a
  128. network header specifying our callsign and that of the ultimate
  129. destination (in this case w9foo).
  130.  
  131.    We can use the netrom route add command to establish a digipeater
  132. path to the neighbor.  For example:
  133.  
  134.     netrom route add #foo w9foo ax0 192 w9rly wd9igi
  135.  
  136. This will cause us to use wd9igi as a digipeater in establishing our
  137. connection to the net/rom node w9rly.
  138.  
  139.    To drop the route to w9foo, you would type
  140.  
  141.     netrom route drop w9foo w9rly ax0
  142.  
  143.    To see the contents of your routing table, you may type
  144.  
  145.     netrom route
  146.  
  147. and to see the routing entries for an individual station you can type
  148.  
  149.     netrom route info <callsign>
  150.  
  151. You may not use an alias as an argument to the netrom route info command.
  152.  
  153.    I can not stress enough that "route add" and "netrom route add" are two
  154. different commands, with different purposes.  In general, you only need a
  155. "netrom route add" if you need to add a route to a net/rom node via a
  156. digipeater path.  If you find yourself using this command, ask yourself,
  157. "Why am I doing this?"  Many people do not understand that net/rom does
  158. automatic routing (well, sort of :-)).
  159.  
  160.  
  161. THE IMPORTANCE OF THE ROUTING TABLE
  162.  
  163.    The NET/ROM routing table is analogous to the IP routing table:  if
  164. there is nothing in it, your NET/ROM traffic will not go out.  You must
  165. either manually enter a list of routes (perhaps via your autoexec.net)
  166. or wait to receive routing broadcasts from your neighbors before your
  167. NET/ROM traffic will leave your station.
  168.  
  169.    If you go to send packets via NET/ROM and nothing happens, even if
  170. you have trace mode on, make sure that the destination node is in your
  171. NET/ROM routing table.  If sending IP traffic, double check the ARP table
  172. for an appropriate NET/ROM ARP entry for the destination node (see below
  173. for more information on the use of the ARP table).  The ARP table is not
  174. used for NET/ROM transport routing.
  175.  
  176.  
  177. INTERFACING WITH NET/ROMS USING YOUR SERIAL PORT
  178.  
  179.    What if you have a net/rom node or nodes, and you'd like to attach
  180. them to your computer via their serial interfaces, and use net as a
  181. packet switch?  It's very easy:  you have to attach those interfaces,
  182. using the "attach asy" command, but specifying type "nrs" instead of
  183. "slip" or "kiss".  "nrs" is the net/rom serial framing protocol, which
  184. is like KISS, but uses different framing characters and has an 8-bit
  185. checksum.
  186.  
  187.    When you attach an nrs interface, it can be used for passing IP
  188. datagrams or AX.25 frames over serial lines or modems.  To use it
  189. for net/rom, you have to identify it to the netrom code just like
  190. any other interface, with the "netrom interface" command.
  191.  
  192.  
  193. THE TIME TO LIVE INITIALIZER
  194.  
  195.    The "netrom ttl" command allows setting of the time-to-live
  196. initializer for NET/ROM datagrams.  I recommend a value of 16
  197. for most networks.  Use more if you expect to go more than 16 hops.
  198. The default is 64.
  199.  
  200.    The purpose of the ttl initializer is to prevent a packet from
  201. getting caught forever in routing loops.  Every router who handles
  202. the packet decrements the ttl field of the network datagram before
  203. sending it on, and when it reaches 0 it is discarded.
  204.  
  205.  
  206. USING NET/ROM SUPPORT FOR IP
  207.  
  208.    Now you know all the commands, but how do we actually use net/rom
  209. for IP communications?  This takes two steps:
  210.  
  211.    Step one:  update the routing table.  In all likelihood, you will
  212. use net/rom to gateway two IP subnets.  So, you'll probably want to
  213. identify a station on each end as a gateway.  Let's say we're on the
  214. Milwaukee subnet, and we want to talk to someone in Madison.  If
  215. we're not the gateway, we just have a routing table entry like this:
  216.  
  217.     route add [44.92.0.0]/24 ax0 wg9ate-pc.ampr
  218.  
  219. This specifies that wg9ate should get all packets for the 44.92.0.x
  220. subnet via interface ax0.
  221.  
  222.    Wg9ate has this routing table entry:
  223.  
  224.     route add [44.92.0.0]/24 netrom w9mad-pc.ampr
  225.  
  226. (presuming that w9mad is the Madison gateway).  Now, when the IP layer
  227. at wg9ate gets datagrams for Madison, it knows that they have to go via
  228. net/rom to w9mad.  Notice that we don't specify a "real" interface,
  229. like ax1 or nr0, in the route entry.  The net/rom network layer will
  230. pick the right interface based on its net/rom routing tables.
  231.  
  232.    We're not done yet, though.  w9mad-pc.ampr is not an ax.25
  233. callsign.  The net/rom send routine called by the IP layer needs
  234. to map from the IP address to an ax.25 address.  It does this via
  235. a manually added arp entry:
  236.  
  237.     arp add w9mad-pc.ampr netrom w9mad
  238.  
  239. [We kind of fudged by using the arp table for this purpose, since
  240. there is no way to do automatic address resolution for net/rom,
  241. and arp messages are never sent or received for net/rom nodes.
  242. However, the arp table does contain precisely what we have here:
  243. mappings from IP addresses to callsigns, and it saved a lot of
  244. code to do it this way.]
  245.  
  246. Notice also that no digipeaters are ever specified in the arp entry
  247. for a net/rom node.  Also, the callsign to which we are mapping
  248. is the final destination of the packet, not the non-destination
  249. neighbor.  That neighbor will be picked based on the net/rom 
  250. routing tables.
  251.  
  252.    So, as a summary, let's look at what happens to a packet that
  253. reaches the IP layer on wg9ate, destined for Madison.  The IP
  254. routing code looks the destination IP address up in the table,
  255. and discovers that it should go via net/rom to w9mad-pc.ampr.
  256. So, it passes the packet to the net/rom send routine.  That
  257. routine uses the arp table to translate w9mad-pc's IP address
  258. to the callsign "w9mad".  Then it passes the packet to the
  259. net/rom routing code.  That code checks to see if the destination
  260. callsign (w9mad) is the same as that of any of its assigned
  261. net/rom interfaces.  Since it isn't, it puts a network layer
  262. header (a.k.a. net/rom level 3 header) on it, and looks for
  263. w9mad in its routing tables.  Presumably, it finds an appropriate
  264. neighbor for the packet, and sends in out via ax.25.  The net/rom
  265. network does the job of actually getting the packet to its 
  266. destination.
  267.  
  268.    At w9mad, the packet's protocol ID causes it to be sent to
  269. the same net/rom routing code that handled the outgoing packet
  270. from wg9ate (running on a different computer, of course).  Now
  271. the destination callsign matches, so the net/rom network layer
  272. header is stripped off, and packet is passed up to the IP layer.
  273. (Net/rom network headers don't have a protocol ID byte, so 
  274. we just hope for the best.  If a net/rom node addresses a
  275. net/rom transport layer packet to us, it is likely to be dropped
  276. by IP for any of a number of reasons.)
  277.  
  278.  
  279. THE NET/ROM TRANSPORT LAYER
  280.  
  281.    NET/ROM transport is the protocol used by NET/ROM node to
  282. communicate end-to-end.  When a user attaches to a NET/ROM
  283. via AX.25, and asks for a connect to a node in the NODES list,
  284. his local NET/ROM tries to open a transport connection to
  285. the destination node over the NET/ROM network.  NET/ROM transport
  286. packets are carried in NET/ROM network datagrams, just like
  287. IP datagrams.
  288.  
  289.    You shouldn't use NET/ROM transport when connecting to other
  290. TCP/IP stations.  TCP is a much better protocol than NET/ROM
  291. transport, and makes better use of available bandwidth.  Also,
  292. BM and SMTP are more convenient to use than a TCP/IP station's
  293. mailbox facility.  However, for communicating with AX.25 users
  294. via the NET/ROM network, the transport facilities in NET will
  295. work better (and more easily) than the traditional method of
  296. connecting to your local node via AX.25.
  297.  
  298.  
  299. CONNECTING VIA NET/ROM TRANSPORT
  300.  
  301.    To connect to the node whose alias is FOO and whose callsign is
  302. W9FOO, you can issue either of the following two commands:
  303.  
  304.     netrom connect foo
  305.  
  306.     netrom connect w9foo
  307.  
  308. If foo:w9foo is in your NET/ROM routing table, your station will
  309. transmit a connect request to the appropriate neighbor used to
  310. reach w9foo.
  311.  
  312.    NET/ROM transport sessions are very much like those for AX.25.
  313. You can use the disconnect, reset, kick, upload, and record
  314. commands, and the session command to switch sessions.
  315.  
  316.  
  317. DISPLAYING THE STATUS OF NET/ROM CONNECTIONS
  318.  
  319.    The command
  320.  
  321.     netrom status
  322.  
  323. is used to display the status of all NET/ROM connections, which will
  324. include those used in keyboard sessions as well as ones attached to
  325. the mailbox.  For more detailed information on a session, you can
  326. use the address of the NET/ROM control block:
  327.  
  328.     netrom status <&nrcb>
  329.  
  330. where <&nrcb> is the hex address given in the short form of the command
  331. or in the "session" display.
  332.  
  333.  
  334. NET/ROM TRANSPORT PARAMETERS
  335.  
  336.    The NET/ROM transport parameters may be set with the various 
  337. NET/ROM subcommands.  Their meanings are listed below:
  338.  
  339.     acktime:    This is the ack delay timer, similary to ax25 t2.
  340.                 The default is 3000 ms.
  341.  
  342.     choketime:    The time to wait before breaking a send choke condition.
  343.                 Choke is the term for NET/ROM flow control.
  344.  
  345.     irtt:        The initial round trip time guess, used for timer setting.
  346.  
  347.     qlimit:        The maximum length of the receive queue for chat sessions.
  348.                 This is similar to ax25 window.
  349.  
  350.     retries:    Maximum retries on connect, disconnect, and data frames.
  351.  
  352.     window:        Maximum sliding window size, negotiated down at connect
  353.                 time.
  354.  
  355.  
  356. THE MAILBOX
  357.  
  358.    The AX.25 mailbox also accepts NET/ROM connections.  The "mbox on"
  359. and "mbox off" commands control whether the mailbox is turned on for
  360. NET/ROM as well as AX.25, and the "mbox" command displays current
  361. mailbox connects of both types.
  362.  
  363.    Many people have observed that the AX.25 mailbox requires the user
  364. to enter a carriage return to bring up the banner and prompt.  This is
  365. because of certain defects of that protocol when it is used as the
  366. link layer for several different higher level protocols, and is 
  367. unavoidable.  (So stop asking, OK? :-))  The NET/ROM mailbox does
  368. not require the carriage return, and will be activated as soon as
  369. the incoming connection is completed.
  370.  
  371.  
  372. WHERE TO GO FOR MORE INFORMATION
  373.  
  374.    The paper "Transmission of IP Datagrams over NET/ROM Networks"
  375. appeared in the Seventh ARRL Networking Conference papers, available
  376. from the ARRL.  In it, I describe the more technical details of how
  377. the NET/ROM network support works.
  378.  
  379.    If you want to learn about NET/ROM, talk your local NET/ROM or TheNET
  380. operator out of his or her manual.  If you want to learn more, read
  381. the source code.  That's about it for sources, since the NET/ROM
  382. protocols originated in a commercial product.
  383.  
  384.  
  385. ABOUT THE CODE
  386.  
  387.    There has been a great deal of controversy about TheNET, a no-charge
  388. NET/ROM clone for TNCs.  This is not the place to discuss the truth
  389. of the charges leveled by Software 2000 against its authors, but that
  390. situation requires me to make the following statement:
  391.  
  392.    The NET/ROM transport support in NET.EXE was not taken in any way,
  393. shape or form from NET/ROM (whose source I have never seen) or from
  394. TheNET.  The protocol code is based on protocol 6 from Tanenbaum's
  395. excellent book, Computer Networks, as a moderately careful reading
  396. of both should show.  The source code is freely distributed, so
  397. the curious reader should have the opportunity to check this assertion
  398. if he or she so desires.
  399.  
  400.    The smoothed round trip time calculation, which is not done in 
  401. "real" NET/ROMs (and should be, by the way -- they'd work a whole
  402. lot better) is adapted from that used by KA9Q in the TCP protocol
  403. in NET.  The dicey business of adapting it to a sliding windows
  404. protocol with selective retransmission was done by me, all alone,
  405. after my cries for help on the tcp-group mailing list went unanswered
  406. :-).
  407.  
  408.    I have taken the precaution of copyrighting the NET/ROM code in
  409. NET.  It may be freely distributed for non-commercial purposes, in
  410. whole or in part, and may be used in other software packages such
  411. as BBS systems if so desired, so long as the copyright notice is
  412. not removed from the source files, and the program in which it is
  413. used displays "NET/ROM code copyright 1989 by Dan Frank, W9NK"
  414. when it starts up.
  415.  
  416.    Any person who wishes to distribute the code, or anything based
  417. on the code, for commercial purposes will find me very reasonable,
  418. but rather insistent about being compensated for the hours I've
  419. spent working on it.
  420.  
  421. ---------------------- Enjoy!
  422.  
  423.    Dan Frank, W9NK (dan@cs.wisc.edu, w9nk@w9wi-1 BBS, #MADIP:W9NK)
  424.  
  425.  
  426.  
  427.